<h4><span class="glyphicon glyphicon-off" aria-hidden-"true"></span> Information on Execution</h4>

<div class="row">
    <div class="col-md-6">
        <section id="information">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h4 class="panel-title">Analysis
                        <div class="pull-right">
                            <a class="btn btn-info btn-xs" href="{% url "compare.views.left" analysis.info.id %}">
                                <span class="glyphicon glyphicon-transfer" aria-hidden="true"></span> Compare analysis to ...
                            </a>
                            <a class="btn btn-info btn-xs" href="{% url "analysis.views.export_analysis" analysis.info.id %}">
                                <span class="glyphicon glyphicon-export" aria-hidden="true"></span> Export analysis
                            </a>
                        </div>
                    </h4>
                </div>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>Category</th>
                            <th>Started</th>
                            <th>Completed</th>
                            <th>Duration</th>
                            <th>Log</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>{{analysis.info.category|upper}}</td>
                            <td>{{analysis.info.started}}</td>
                            <td>{{analysis.info.ended}}</td>
                            <td>{{analysis.info.duration}} seconds</td>
                            <td><a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#info-log">Show Log</a></td>
                        </tr>
                    </tbody>
                </table>
            </div>

            {% if analysis.debug.errors %}
                <ul style="font-size: 16px;">
                {% for error in analysis.debug.errors %}
                    <li class="text-danger"><b>Error:</b> {{error}}</li>
                {% endfor %}
                </ul>
            {% endif %}

        </section>
    </div>
    <div class="col-md-6">
        {% if analysis.info.machine and analysis.info.machine.name %}
            <section id="machine">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <h4 class="panel-title">Machine</h4>
                    </div>
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Label</th>
                                <th>Started On</th>
                                <th>Shutdown On</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>{{analysis.info.machine.name}}</td>
                                <td>{{analysis.info.machine.label}}</td>
                                <td>{{analysis.info.machine.started_on}}</td>
                                <td>{{analysis.info.machine.shutdown_on}}</td>
                            </tr>
                        </tbody>
                    </table>
                    </div>
            </section>
        {% endif %}

    </div>
</div>

<div class="row">
    <div class="col-md-12">
        <div id="info-log" class="collapse">
            <h4><span class="glyphicon glyphicon-list" aria-hidden="true"></span> Activity Log</h4>
            <pre>{{analysis.debug.log|join:""}}</pre>
        </div>
    </div>
</div>
